package cn.gov.cus.rmftquartz.common.utils;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * 这个是kyou-1.0.jar(貌似是github上的)的cn.ok中的
 * @author wxming
 *
 */
public class ExceptionHelper {
	private static String MSG_HEADER = "Exception Detail: ";
	
	public ExceptionHelper(){}
	
	public static String getExMsg(Exception e){
		StringWriter sw = new StringWriter();
		e.printStackTrace(new PrintWriter(sw,true));
		return MSG_HEADER + sw.toString();
	}
	
	public static String getExMsg(Throwable t){
		StringWriter sw = new StringWriter();
		t.printStackTrace(new PrintWriter(sw,true));
		return MSG_HEADER + sw.toString();
	}
	

}
